﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
    <%--<script>
        $(function () {
            var dialog, form,

              // From http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#e-mail-state-%28type=email%29
              emailRegex = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,
              name = $("#name"),
              email = $("#email"),
              password = $("#password"),
              allFields = $([]).add(name).add(email).add(password),
              tips = $(".validateTips");

            function updateTips(t) {
                tips
                  .text(t)
                  .addClass("ui-state-highlight");
                setTimeout(function () {
                    tips.removeClass("ui-state-highlight", 1500);
                }, 500);
            }

            function checkLength(o, n, min, max) {
                if (o.val().length > max || o.val().length < min) {
                    o.addClass("ui-state-error");
                    updateTips("Length of " + n + " must be between " +
                      min + " and " + max + ".");
                    return false;
                } else {
                    return true;
                }
            }

            function checkRegexp(o, regexp, n) {
                if (!(regexp.test(o.val()))) {
                    o.addClass("ui-state-error");
                    updateTips(n);
                    return false;
                } else {
                    return true;
                }
            }

            function addUser() {
                var valid = true;
                allFields.removeClass("ui-state-error");

                valid = valid && checkLength(name, "username", 3, 16);
                valid = valid && checkLength(email, "email", 6, 80);
                valid = valid && checkLength(password, "password", 5, 16);

                valid = valid && checkRegexp(name, /^[a-z]([0-9a-z_\s])+$/i, "Username may consist of a-z, 0-9, underscores, spaces and must begin with a letter.");
                valid = valid && checkRegexp(email, emailRegex, "eg. ui@jquery.com");
                valid = valid && checkRegexp(password, /^([0-9a-zA-Z])+$/, "Password field only allow : a-z 0-9");

                if (valid) {
                    $("#users tbody").append("<tr>" +
                      "<td>" + name.val() + "</td>" +
                      "<td>" + email.val() + "</td>" +
                      "<td>" + password.val() + "</td>" +
                    "</tr>");
                    dialog.dialog("close");
                }
                return valid;
            }

            dialog = $("#dialog-form").dialog({
                autoOpen: false,
                show: {
                    effect: "blind",
                    duration: 200
                },
                hide: {
                    effect: "blind",
                    duration: 200
                },
                height: 300,
                width: 350,
                modal: true,
                buttons: {
                    "Create an account": addUser,
                    "Annuller": function () {
                        dialog.dialog("close");
                    }
                },
                open: function () {
                    $(this).closest(".ui-dialog")
                        .find(".ui-button")
                        .addClass("button");
                },
                close: function () {
                    form[0].reset();
                    allFields.removeClass("ui-state-error");
                }
            });

            form = dialog.find("form").on("submit", function (event) {
                event.preventDefault();
                addUser();
            });

            $("#create-user").button().on("click", function () {
                dialog.dialog("open");
            });
        });

    </script>--%>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <div id="entranceHeaderTextField">
        <asp:Label Text="VELKOMMEN TIL UCN-LINK" runat="server" />
    </div>
    <div class="entranceTextField">
        <asp:Label Text="Noget forklaring omkring siden." runat="server" />
    </div>
    <div id="imageEntrance">
        <asp:ImageButton ImageUrl="~/Images/LeftDoor.png" runat="server" OnClick="btnLeftDoor_Click" ToolTip="Klik her hvis du har en opgave studerende kan opfylde for dig"
            ID="btnLeftDoor" CssClass="img-entrance" CommandArgument="1" onmouseover="this.src='Images/LeftDoorClicked.png';" onmouseout="this.src='Images/LeftDoor.png'" />
        <asp:ImageButton ImageUrl="~/Images/RightDoor.png" ID="btnRightDoor" runat="server" ToolTip="Klik her hvis du er studerende eller undervisere på en UCN uddannelse"
            OnClick="btnRightDoor_Click" CommandArgument="2" CssClass="img-entrance" onmouseover="this.src='Images/RightDoorClicked.png';" onmouseout="this.src='Images/RightDoor.png'" />
    </div>
    <div class="entranceTextField" style="border-top: 1px solid #f08100; border-top-left-radius: 5px; border-top-right-radius: 5px; margin-top: 35px;">
        <asp:Label Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation Dybere forklaring om hvad man skal vælge." runat="server" />
    </div>

  <%--  <div id="dialog-form" title="Log på">
        <p class="validationTips">Alle felter skal udfyldes.</p>
        <label for="name">Navn</label>
        <input type="text" name="name" id="name" />
        <label for="password">Kodeord</label>
        <input type="password" name="password" id="password" />
        <input type="submit" tabindex="-1" style="position:absolute; top:-1000px;" />
</div>
    <input type="button" id="create-user" value="knappen" />--%>

</asp:Content>
